/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.pbp.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 *
 * @author Kim
 */
@Entity
@Table(name = "user")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class User implements Serializable{
    
     @Id
    @Column(name = "kode_user")
    private String kodeUser;
    
    @Column(name = "display_name")
    private String displayName;
    
    @Column(name = "email_user")
    private String emailuser;
    
    @Column(name = "password_user")
    private String passwordUser;
    
    @Column(name = "first_name")
    private String firstName;
    
    @Column(name = "last_name")
    private String lastName;
    
    @Column(name = "gender")
    private String gender;
    
    @Column(name = "user_type")
    private String userType;
    
    @Column(name = "interested_genre")
    private String interestedGenre;
    
    @Column(name = "photo")
    private String photo;
    
    @OneToMany(mappedBy="user",fetch=FetchType.LAZY,cascade=CascadeType.ALL)
    @LazyCollection(LazyCollectionOption.EXTRA)
    @Fetch(FetchMode.SELECT)
    private Set<BukuUser> bukuUserList = new HashSet<BukuUser>();

    public String getInterestedGenre() {
        return interestedGenre;
    }

    public void setInterestedGenre(String interestedGenre) {
        this.interestedGenre = interestedGenre;
    }

    public String getKodeUser() {
        return kodeUser;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getEmailuser() {
        return emailuser;
    }

    public String getPasswordUser() {
        return passwordUser;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String getGender() {
        return gender;
    }

    public void setKodeUser(String kodeUser) {
        this.kodeUser = kodeUser;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public void setEmailuser(String emailuser) {
        this.emailuser = emailuser;
    }

    public void setPasswordUser(String passwordUser) {
        this.passwordUser = passwordUser;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public Set<BukuUser> getBukuUserList() {
        return bukuUserList;
    }

    public void setBukuUserList(Set<BukuUser> bukuUserList) {
        this.bukuUserList = bukuUserList;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }
    
}
